﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Yunchang;

namespace AutoChess
{
    public enum ShipState
    {
        Idel,
        MoveState,
        FireTheHole,
    }
    public class ShipBehaviourCtr : FsmControllerBase<ShipState>
    {
        public ShipRenderer render;
        public MovePackage package;
        public ShipFirePackage firePakage;
        public ShipBehaviourCtr(ShipRenderer render)
        {
            this.render = render; 
            InitState();
        }
        public override void InitState()
        {
            base.InitState();
            allStates[ShipState.Idel] = new ShipIdleState(ShipState.Idel, this);
            allStates[ShipState.MoveState] = new ShipMoveState(ShipState.MoveState, this);
            allStates[ShipState.FireTheHole] = new ShipFireState(ShipState.FireTheHole, this);
        }

        public void SwitchMoveState(MovePackage package)
        {
            this.package = package;
            SwitchState(ShipState.MoveState);
        }
        public void SwitchFireState(ShipFirePackage firePakage)
        {
            this.firePakage = firePakage;
            SwitchState(ShipState.FireTheHole);
        }
    }
}
